package com.youjp.letcode.let01;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @PackageName: com.youjp.letcode.let01
 * @author: youjp
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @create: 2023-10-30 20:33
 * @description:
 * @Version: 1.0
 */
public class Solution {
    public int[] twoSum(int[] nums, int target) {
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j <nums.length ; j++) {
                if(nums[i]+nums[j]== target){
                    return new int[]{i,j};
                }
            }
        }
        throw new IllegalArgumentException("No two sum solution");
    }


    public static void main(String[] args) {
        int nums[] ={2,7,11,15};
        int target=9;
        System.out.println(Arrays.toString(new Solution().twoSum(nums,target)));
    }

}
